package belka.us.ohostoggleswitch.slice;

import belka.us.ohostoggleswitch.MultipleToggleSwitch;
import belka.us.ohostoggleswitch.ResourceTable;
import belka.us.ohostoggleswitch.ToggleSwitch;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;

import java.util.ArrayList;

public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);

        MultipleToggleSwitch multipleToggleSwitch = (MultipleToggleSwitch)findComponentById(ResourceTable.Id_multiple_toggle_switch);
       // multipleToggleSwitch.setLabels(new ArrayList<>());


        ToggleSwitch toggleSwitch = (ToggleSwitch) findComponentById(ResourceTable.Id_n_items_toggle_switch);
        ArrayList<String> labels = new ArrayList<>();
        labels.add("A");
        labels.add("B");
        labels.add("C");
        labels.add("D");
       // multipleToggleSwitch.setLabels(labels);
       toggleSwitch.setLabels(labels);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
